﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;

namespace HeThongThongTin.UI.SL.BaoCaoThongKe.DanhMuc.DM_CaNhan
{
    public partial class DM_CaNhanReport : ChildWindow
    {
        private List<string> selectedFields;
        public DM_CaNhanReport(List<string> selectedFields)
        {
            StyleManager.ApplicationTheme = new Office_BlackTheme();
            InitializeComponent();
            this.selectedFields = selectedFields;
           
            this.ReportViewer1.Report = "HeThongThongTin.Library.RP.DanhMuc.CaNhanReport, HeThongThongTin.Library.RP";
            this.ReportViewer1.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(ReportViewer1_RenderBegin);
            
        }

        void ReportViewer1_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
        {
          
            args.ParameterValues["HoTenParameter"] = selectedFields.Contains("HoTen");
            args.ParameterValues["NgaySinhParameter"] = selectedFields.Contains("NgaySinh");
            args.ParameterValues["GioiTinhParameter"] = selectedFields.Contains("GioiTinh");
            args.ParameterValues["DanTocParameter"] = selectedFields.Contains("DanToc");
            args.ParameterValues["QuocTichParameter"] = selectedFields.Contains("QuocTich");
            args.ParameterValues["HoChieuCMNDParameter"] = selectedFields.Contains("HoChieuCMND");
            args.ParameterValues["NoiThuongTruParameter"] = selectedFields.Contains("NoiThuongTru");
            args.ParameterValues["ChoOHienTaiParameter"] = selectedFields.Contains("ChoOHienTai");
            args.ParameterValues["TrinhDoParameter"] = selectedFields.Contains("TrinhDo");
            args.ParameterValues["ChucDanhParameter"] = selectedFields.Contains("ChucDanh");
            args.ParameterValues["DonViParameter"] = selectedFields.Contains("DonVi");
            args.ParameterValues["NgheNghiepParameter"] = selectedFields.Contains("NgheNghiep");
            args.ParameterValues["DienThoaiParameter"] = selectedFields.Contains("DienThoai");
            args.ParameterValues["EmailParameter"] = selectedFields.Contains("Email");
            
        }
    }
}

